package com.rabbiter.oes.serviceimpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.oes.entity.College;
import com.rabbiter.oes.mapper.CollegeMapper;
import com.rabbiter.oes.service.CollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CollegeServiceImpl implements CollegeService {
   @Autowired
    private CollegeMapper collegeMapper;

    @Override
    public IPage<College> findAll(Page<College> page) {
        return collegeMapper.findAll(page);
    }

    @Override
    public List<College> findAll() {
        Page<College> collegePage = new Page<>(0,9999);
        return collegeMapper.findAll(collegePage).getRecords();
    }


    @Override
    public College selectCollegeById(int id) {
        return collegeMapper.selectCollegeById(id);
    }

    @Override
    public int updateCollege(College college) {
        return collegeMapper.updateCollege(college);
    }

    @Override
    public int deleteCollege(int id) {
        return collegeMapper.deleteCollege(id);
    }

    @Override
    public int addCollege(College college) {
        return collegeMapper.addCollege(college);
    }
}
